home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / include / gppconio.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  116 lines

  1. /**********************************************************************
  2.  *  
  3.  *  NAME:           gppconio.h
  4.  *  
  5.  *  DESCRIPTION:    simulate Borland text video funcs for GNU C++
  6.  *  
  7.  *  copyright (c) 1991 J. Alan Eldridge
  8.  * 
  9.  *  M O D I F I C A T I O N   H I S T O R Y
  10.  *
  11.  *  when        who                 what
  12.  *  -------------------------------------------------------------------
  13.  *  10/27/91    J. Alan Eldridge    created
  14.  *  
  15.  *********************************************************************/
  16.  
  17. #ifndef __GPPCONIO_H
  18. #define __GPPCONIO_H
  19.  
  20. #if defined(__TURBOC__)
  21. #error  Use conio.h for Borland compilers!
  22. #endif
  23.  
  24. extern int directvideo; /* ignored by gppconio */
  25. extern int _wscroll;
  26.  
  27. #define _NOCURSOR      0
  28. #define _SOLIDCURSOR   1
  29. #define _NORMALCURSOR  2
  30.  
  31. struct text_info {
  32.     unsigned char winleft;
  33.     unsigned char wintop;
  34.     unsigned char winright;
  35.     unsigned char winbottom;
  36.     unsigned char attribute;
  37.     unsigned char normattr;
  38.     unsigned char currmode;
  39.     unsigned char screenheight;
  40.     unsigned char screenwidth;
  41.     unsigned char curx;
  42.     unsigned char cury;
  43. };
  44.  
  45. enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };
  46.  
  47. enum COLORS {
  48.     /*  dark colors     */
  49.     BLACK,          
  50.     BLUE,
  51.     GREEN,
  52.     CYAN,
  53.     RED,
  54.     MAGENTA,
  55.     BROWN,
  56.     LIGHTGRAY,
  57.     /*  light colors    */
  58.     DARKGRAY,
  59.     LIGHTBLUE,
  60.     LIGHTGREEN,
  61.     LIGHTCYAN,
  62.     LIGHTRED,
  63.     LIGHTMAGENTA,
  64.     YELLOW,
  65.     WHITE
  66. };
  67.  
  68. #define BLINK   0x80    /*  blink bit   */
  69.  
  70. #ifdef  __cplusplus
  71. extern "C" {
  72. #endif
  73.  
  74. void    clreol(void);
  75. void    clrscr(void);
  76. void    gotoxy(int x, int y);
  77. int     wherex(void);
  78. int     wherey(void);
  79. int     putch(int c);
  80. int     getch(void);
  81. int     getche(void);
  82. int     ungetch(int); 
  83. int     kbhit(void);
  84. int     _conio_kbhit(void); /* checks for ungetch char */
  85. void    delline(void);
  86. int     gettext(int left, int top, int right, int bottom, void *destin);
  87. void    gettextinfo(struct text_info *r);
  88. void    highvideo(void);
  89. void    insline(void);
  90. void    lowvideo(void);
  91. int     movetext(int left, int top, int right, int bottom, 
  92.             int destleft, int desttop);
  93. void    normvideo(void);
  94. int     puttext(int left, int top, int right, int bottom, void *source);
  95. void    textattr(int attr);
  96. void    textbackground(int color);
  97. void    textcolor(int color);
  98. void    textmode(int unused_mode);
  99. void    window(int left, int top, int right, int bottom);
  100. void    _setcursortype(int unused_type);
  101. char    *cgets(char *str); 
  102. int     cprintf(const char *format, ...);
  103. int     cputs(const char *str);
  104. int     cscanf(const char *format, ...); 
  105. /* char    *getpass(const char *prompt); */
  106. void gppconio_init(void);
  107.  
  108. #ifdef  __cplusplus
  109. }
  110. #endif
  111.  
  112. #define kbhit _conio_kbhit /* Who ever includes gppconio.h probably
  113.                               also wants _conio_kbhit and not kbhit
  114.                               from libc */
  115. #endif
  116.